package dao;

import entity.Book;
import entity.User;

import java.sql.SQLException;
import java.util.List;

public interface BookDao {
    //查询此书是否存在
    public boolean isExist(String bookId) throws SQLException;

    //判断书籍未被借阅
    public boolean isIn(String bookId) throws SQLException;

    //修改图书状态
    public boolean updateStat(String bookId,String state) throws SQLException;

    //添加书籍
    public boolean addBook(Book book) throws SQLException;

    //查询全部书籍
    public List<Book> queryAllBooks() throws SQLException;

    //根据书籍Id查书
    public Book queryBookById(String bookId) throws SQLException;

    //根据书籍Id删除书籍
    public boolean deleteBookById(String bookId) throws SQLException;

    //根据书籍Id修改书籍
    public boolean updateBookById(String bookId,Book book) throws SQLException;

    //查询总数据数
    public int getTotalCount(String sql,Object[] params) throws SQLException;

    //查询当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<Book> queryBookByPage(int currentPage,int pageSize) throws SQLException;

    //根据账号或书名查询当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<Book> queryBookByPageRequire(int currentPage,int pageSize,Object param) throws SQLException;

    //查询可借阅书籍当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<Book> queryBorrowBookByPage(int currentPage,int pageSize) throws SQLException;

    //根据书籍信息查询可借阅书籍当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<Book> queryBorrowBookByPageRequire(int currentPage,int pageSize,Object param) throws SQLException;

    //查询可归还书籍当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<Book> queryReturnBookByPage(int currentPage,int pageSize,String userId) throws SQLException;

    //根据书籍信息查询可归还书籍当前页的数据集合 currentPage(当前页码) pageSize(页面大小)
    public List<Book> queryReturnBookByPageRequire(int currentPage,int pageSize,String userId,Object param) throws SQLException;
}
